/*
* 科技有限公司版权所有（）.
* Copyright (c) 2019,    and/or its affiliates. All rights reserved.
* @Date: 2020.08.03 21:52.
* @Author
* @Description  项目 脚部 - tab 切换
**/
<template>
  <ul class="pr-footer-tab">
    <li @click="handleTabClick('detail')" :class="{'active': flag === 'detail'}"><i class="iconfont iconzhuye"></i>首页</li>
    <li @click="handleTabClick('list')" :class="{'active': flag === 'list'}"><i class="iconfont iconjiayouzhan"></i>加油站列表</li>
    <li @click="handleTabClick('center')" :class="{'active': flag === 'center'}"><i class="iconfont icongerenzhongxin"></i>个人中心</li>
  </ul>
</template>

<script>

export default {
  name: 'footerTab',
  props: ['flag'],
  components: {},
  data() {
    return {

    }
  },
  watch: {},
  mounted() {
  },
  created() {
  },
  methods: {
    /**
     *@Description
     *@Param
     *@Return 点击 tab 切换 事件.
     **/
    handleTabClick(type) {
      if (type === 'detail') {
        this.$router.push({ name: 'Detail', params: { id: '123' } })
      } else if (type === 'list') {
        this.$router.push({ name: 'AddressList', params: { id: '123' } })
      } else {
        this.$router.push({ name: 'UseList', params: { id: '123' } })
      }
    },


  }
}
</script>
<style lang="scss" scoped>
.pr-footer-tab {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding-top: 5px;
  overflow: hidden;
  background: #fff;
  border-top: 1px solid #dcdcdc;
  li {
    width: calc(100% / 3);
    float: left;
    text-align: center;
    box-sizing: border-box;
    font-size: 12px;
    color: #9b9b9b;
  }
  i {
    display: block;
    font-size: 18px;
  }
  .active {
    color: #409eff;
  }
}
</style>
